<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>1.2. IMS Question and Test Interoperability (version 1.2) &mdash; Pyslet 0.4.20140526 documentation</title>
    
    <link rel="stylesheet" href="_static/default.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    './',
        VERSION:     '0.4.20140526',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="top" title="Pyslet 0.4.20140526 documentation" href="index.html" />
    <link rel="up" title="1. IMS Global Learning Consortium Specifications" href="ims.html" />
    <link rel="next" title="1.2.1. Core Types and Utilities" href="qtiv1/core.html" />
    <link rel="prev" title="1.1. IMS Content Packaging (version 1.2)" href="imscpv1p2.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="qtiv1/core.html" title="1.2.1. Core Types and Utilities"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="imscpv1p2.html" title="1.1. IMS Content Packaging (version 1.2)"
             accesskey="P">previous</a> |</li>
        <li><a href="index.html">Pyslet 0.4.20140526 documentation</a> &raquo;</li>
          <li><a href="ims.html" accesskey="U">1. IMS Global Learning Consortium Specifications</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="ims-question-and-test-interoperability-version-1-2">
<h1>1.2. IMS Question and Test Interoperability (version 1.2)<a class="headerlink" href="#ims-question-and-test-interoperability-version-1-2" title="Permalink to this headline">¶</a></h1>
<p>The IMS Question and Test Interoperability (QTI) specification version 1.2 was
finalized in 2002.  After a gap of 1-2 years work started on a major revision,
culminating in version 2 of the specification, published first in 2005.  For
information about the history of the specification see
<a class="reference external" href="http://en.wikipedia.org/wiki/QTI">http://en.wikipedia.org/wiki/QTI</a> - official information about the specification
is available from the IMS GLC: <a class="reference external" href="http://www.imsglobal.org/question/index.html">http://www.imsglobal.org/question/index.html</a></p>
<p>The purpose of this module is to allow documents in QTI v1 format to be parsed
and then transformed into objects representing the QTI v2 data model where more
sophisticated processing can be performed.  Effectively, the native model of
assessment items in Pyslet (and in the PyAssess package it supersedes) is QTI v2
and this module simply provides an import capability for legacy data marked up
as QTI v1 items.</p>
<p>Class methods or functions with names beginning MigrateV2 use a common pattern
for performing the conversion.  Errors and warnings are logged during conversion
to a list passed in as the <em>log</em> parameter.</p>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="qtiv1/core.html">1.2.1. Core Types and Utilities</a><ul>
<li class="toctree-l2"><a class="reference internal" href="qtiv1/core.html#enumerations">1.2.1.1. Enumerations</a></li>
<li class="toctree-l2"><a class="reference internal" href="qtiv1/core.html#utility-functions">1.2.1.2. Utility Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="qtiv1/core.html#constants">1.2.1.3. Constants</a></li>
<li class="toctree-l2"><a class="reference internal" href="qtiv1/core.html#exceptions">1.2.1.4. Exceptions</a></li>
<li class="toctree-l2"><a class="reference internal" href="qtiv1/core.html#abstract-elements">1.2.1.5. Abstract Elements</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="qtiv1/common.html">1.2.2. Common Classes</a><ul>
<li class="toctree-l2"><a class="reference internal" href="qtiv1/common.html#content-model">1.2.2.1. Content Model</a></li>
<li class="toctree-l2"><a class="reference internal" href="qtiv1/common.html#metadata-model">1.2.2.2. Metadata Model</a></li>
<li class="toctree-l2"><a class="reference internal" href="qtiv1/common.html#objectives-rubric">1.2.2.3. Objectives &amp; Rubric</a></li>
<li class="toctree-l2"><a class="reference internal" href="qtiv1/common.html#response-processing-model">1.2.2.4. Response Processing Model</a></li>
<li class="toctree-l2"><a class="reference internal" href="qtiv1/common.html#miscellaneous-classes">1.2.2.5. Miscellaneous Classes</a></li>
</ul>
</li>
</ul>
</div>
<span class="target" id="module-pyslet.imsqtiv1p2p1"></span><dl class="class">
<dt id="pyslet.imsqtiv1p2p1.QTIDocument">
<em class="property">class </em><tt class="descclassname">pyslet.imsqtiv1p2p1.</tt><tt class="descname">QTIDocument</tt><big>(</big><em>**args</em><big>)</big><a class="headerlink" href="#pyslet.imsqtiv1p2p1.QTIDocument" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="xml20081126.html#pyslet.xml20081126.structures.Document" title="pyslet.xml20081126.structures.Document"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.xml20081126.structures.Document</span></tt></a></p>
<p>Class for working with QTI documents.</p>
<p>We turn off the parsing of external general entities to prevent a
missing DTD causing the parse to fail.  This is a significant limitation
as it is possible that some sophisticated users have used general
entities to augment the specification or to define boiler-plate code. 
If this causes problems then you can turn the setting back on again for
specific instances of the parser that will be used with that type of
data.</p>
<dl class="method">
<dt id="pyslet.imsqtiv1p2p1.QTIDocument.XMLParser">
<tt class="descname">XMLParser</tt><big>(</big><em>entity</em><big>)</big><a class="headerlink" href="#pyslet.imsqtiv1p2p1.QTIDocument.XMLParser" title="Permalink to this definition">¶</a></dt>
<dd><p>Adds some options to the basic XMLParser to improve QTI compatibility.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.imsqtiv1p2p1.QTIDocument.GetElementClass">
<tt class="descname">GetElementClass</tt><big>(</big><em>name</em><big>)</big><a class="headerlink" href="#pyslet.imsqtiv1p2p1.QTIDocument.GetElementClass" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the class to use to represent an element with the given name.</p>
<p>This method is used by the XML parser.  The class object is looked up in
the classMap, if no specialized class is found then the general
<tt class="xref py py-class docutils literal"><span class="pre">pyslet.xml20081126.Element</span></tt> class is returned.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.imsqtiv1p2p1.QTIDocument.RegisterMatThing">
<tt class="descname">RegisterMatThing</tt><big>(</big><em>matThing</em><big>)</big><a class="headerlink" href="#pyslet.imsqtiv1p2p1.QTIDocument.RegisterMatThing" title="Permalink to this definition">¶</a></dt>
<dd><p>Registers a MatThing instance in the dictionary of matThings.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.imsqtiv1p2p1.QTIDocument.FindMatThing">
<tt class="descname">FindMatThing</tt><big>(</big><em>linkRefID</em><big>)</big><a class="headerlink" href="#pyslet.imsqtiv1p2p1.QTIDocument.FindMatThing" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the mat&lt;thing&gt; element with label matching the <em>linkRefID</em>.</p>
<p>The specification says that material_ref should be used if you want to
refer a material object, not matref, however this rule is not
universally observed so if we don&#8217;t find a basic mat&lt;thing&gt; we will
search the material objects too and return a <tt class="xref py py-class docutils literal"><span class="pre">Material</span></tt>
instance instead.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.imsqtiv1p2p1.QTIDocument.RegisterMaterial">
<tt class="descname">RegisterMaterial</tt><big>(</big><em>material</em><big>)</big><a class="headerlink" href="#pyslet.imsqtiv1p2p1.QTIDocument.RegisterMaterial" title="Permalink to this definition">¶</a></dt>
<dd><p>Registers a Material instance in the dictionary of labelled material objects.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.imsqtiv1p2p1.QTIDocument.FindMaterial">
<tt class="descname">FindMaterial</tt><big>(</big><em>linkRefID</em><big>)</big><a class="headerlink" href="#pyslet.imsqtiv1p2p1.QTIDocument.FindMaterial" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the material element with label matching <em>linkRefID</em>.</p>
<p>Like <a class="reference internal" href="#pyslet.imsqtiv1p2p1.QTIDocument.FindMatThing" title="pyslet.imsqtiv1p2p1.QTIDocument.FindMatThing"><tt class="xref py py-meth docutils literal"><span class="pre">FindMatThing()</span></tt></a> this method will search for instances of
<tt class="xref py py-class docutils literal"><span class="pre">MatThingMixin</span></tt> if it can&#8217;t find a <tt class="xref py py-class docutils literal"><span class="pre">Material</span></tt>
element to match.  The specification is supposed to be strict about
matching the two types of reference but errors are common, even in the
official example set.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.imsqtiv1p2p1.QTIDocument.MigrateV2">
<tt class="descname">MigrateV2</tt><big>(</big><em>cp</em><big>)</big><a class="headerlink" href="#pyslet.imsqtiv1p2p1.QTIDocument.MigrateV2" title="Permalink to this definition">¶</a></dt>
<dd><p>Converts the contents of this document to QTI v2</p>
<p>The output is stored into the content package passed in cp.  Errors and
warnings generated by the migration process are added as annotations to
the resulting resource objects in the content package.</p>
<p>The function returns a list of 4-tuples, one for each object migrated.</p>
<p>Each tuple comprises ( &lt;QTI v2 Document&gt;, &lt;LOM Metadata&gt;, &lt;log&gt;, &lt;Resource&gt; )</p>
</dd></dl>

</dd></dl>

<div class="section" id="questestinterop-elements">
<h2>1.2.3. QuesTestInterop Elements<a class="headerlink" href="#questestinterop-elements" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="pyslet.imsqtiv1p2p1.QuesTestInterop">
<em class="property">class </em><tt class="descclassname">pyslet.imsqtiv1p2p1.</tt><tt class="descname">QuesTestInterop</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.imsqtiv1p2p1.QuesTestInterop" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="qtiv1/common.html#pyslet.qtiv1.common.QTICommentContainer" title="pyslet.qtiv1.common.QTICommentContainer"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv1.common.QTICommentContainer</span></tt></a></p>
<p>The &lt;questestinterop&gt; element is the outermost container for the QTI
contents i.e. the container of the Assessment(s), Section(s) and Item(s):</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;!ELEMENT questestinterop (qticomment? , (objectbank | assessment | (section | item)+))&gt;
</pre></div>
</div>
<dl class="method">
<dt id="pyslet.imsqtiv1p2p1.QuesTestInterop.MigrateV2">
<tt class="descname">MigrateV2</tt><big>(</big><big>)</big><a class="headerlink" href="#pyslet.imsqtiv1p2p1.QuesTestInterop.MigrateV2" title="Permalink to this definition">¶</a></dt>
<dd><p>Converts this element to QTI v2</p>
<p>Returns a list of tuples of the form:
( &lt;QTIv2 Document&gt;, &lt;Metadata&gt;, &lt;List of Log Messages&gt; ).</p>
<p>One tuple is returned for each of the objects found. In QTIv2 there is
no equivalent of QuesTestInterop.  The baseURI of each document is set
from the baseURI of the QuesTestInterop element using the object
identifier to derive a file name.</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="object-bank-elements">
<h2>1.2.4. Object Bank Elements<a class="headerlink" href="#object-bank-elements" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="pyslet.imsqtiv1p2p1.ObjectBank">
<em class="property">class </em><tt class="descclassname">pyslet.imsqtiv1p2p1.</tt><tt class="descname">ObjectBank</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.imsqtiv1p2p1.ObjectBank" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="qtiv1/common.html#pyslet.qtiv1.common.MetadataContainerMixin" title="pyslet.qtiv1.common.MetadataContainerMixin"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv1.common.MetadataContainerMixin</span></tt></a>, <a class="reference internal" href="qtiv1/common.html#pyslet.qtiv1.common.QTICommentContainer" title="pyslet.qtiv1.common.QTICommentContainer"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv1.common.QTICommentContainer</span></tt></a></p>
<p>This is the container for the Section(s) and/or Item(s) that are to be
grouped as an object-bank. The object-bank is assigned its own unique
identifier and can have the full set of QTI-specific meta-data:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;!ELEMENT objectbank (qticomment? , qtimetadata* , (section | item)+)&gt;  
&lt;!ATTLIST objectbank  ident CDATA  #REQUIRED &gt;
</pre></div>
</div>
</dd></dl>

</div>
<div class="section" id="assessment-elements">
<h2>1.2.5. Assessment Elements<a class="headerlink" href="#assessment-elements" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="pyslet.imsqtiv1p2p1.Assessment">
<em class="property">class </em><tt class="descclassname">pyslet.imsqtiv1p2p1.</tt><tt class="descname">Assessment</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.imsqtiv1p2p1.Assessment" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="qtiv1/common.html#pyslet.qtiv1.common.QTICommentContainer" title="pyslet.qtiv1.common.QTICommentContainer"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv1.common.QTICommentContainer</span></tt></a></p>
<p>The Assessment data structure is used to contain the exchange of test
data structures. It will always contain at least one Section and may contain
meta-data, objectives, rubric control switches, assessment-level processing,
feedback and selection and sequencing information for sections:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;!ELEMENT assessment (qticomment? ,
        duration? ,
        qtimetadata* ,
        objectives* ,
        assessmentcontrol* ,
        rubric* ,
        presentation_material? ,
        outcomes_processing* ,
        assessproc_extension? ,
        assessfeedback* ,
        selection_ordering? ,
        reference? ,
        (sectionref | section)+
        )&gt;
&lt;!ATTLIST assessment  ident CDATA  #REQUIRED
                                           %I_Title;
                                           xml:lang CDATA  #IMPLIED &gt;
</pre></div>
</div>
<dl class="method">
<dt id="pyslet.imsqtiv1p2p1.Assessment.MigrateV2">
<tt class="descname">MigrateV2</tt><big>(</big><em>output</em><big>)</big><a class="headerlink" href="#pyslet.imsqtiv1p2p1.Assessment.MigrateV2" title="Permalink to this definition">¶</a></dt>
<dd><p>Converts this assessment to QTI v2</p>
<p>For details, see QuesTestInterop.MigrateV2.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pyslet.imsqtiv1p2p1.AssessmentControl">
<em class="property">class </em><tt class="descclassname">pyslet.imsqtiv1p2p1.</tt><tt class="descname">AssessmentControl</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.imsqtiv1p2p1.AssessmentControl" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="qtiv1/common.html#pyslet.qtiv1.common.QTICommentContainer" title="pyslet.qtiv1.common.QTICommentContainer"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv1.common.QTICommentContainer</span></tt></a></p>
<p>The control switches that are used to enable or disable the display of
hints, solutions and feedback within the Assessment:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;!ELEMENT assessmentcontrol (qticomment?)&gt;
&lt;!ATTLIST assessmentcontrol
        hintswitch  (Yes | No )  &#39;Yes&#39;
        solutionswitch  (Yes | No )  &#39;Yes&#39;
        view    (All | Administrator | AdminAuthority | Assessor | Author |
                        Candidate | InvigilatorProctor | Psychometrician | Scorer | 
                        Tutor ) &#39;All&#39;
        feedbackswitch  (Yes | No )  &#39;Yes&#39; &gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.imsqtiv1p2p1.AssessProcExtension">
<em class="property">class </em><tt class="descclassname">pyslet.imsqtiv1p2p1.</tt><tt class="descname">AssessProcExtension</tt><big>(</big><em>parent</em>, <em>name=None</em><big>)</big><a class="headerlink" href="#pyslet.imsqtiv1p2p1.AssessProcExtension" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="qtiv1/core.html#pyslet.qtiv1.core.QTIElement" title="pyslet.qtiv1.core.QTIElement"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv1.core.QTIElement</span></tt></a></p>
<p>This is used to contain proprietary alternative Assessment-level
processing functionality:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;!ELEMENT assessproc_extension ANY&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.imsqtiv1p2p1.AssessFeedback">
<em class="property">class </em><tt class="descclassname">pyslet.imsqtiv1p2p1.</tt><tt class="descname">AssessFeedback</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.imsqtiv1p2p1.AssessFeedback" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="qtiv1/common.html#pyslet.qtiv1.common.QTICommentContainer" title="pyslet.qtiv1.common.QTICommentContainer"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv1.common.QTICommentContainer</span></tt></a>, <a class="reference internal" href="qtiv1/common.html#pyslet.qtiv1.common.ContentMixin" title="pyslet.qtiv1.common.ContentMixin"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv1.common.ContentMixin</span></tt></a></p>
<p>The container for the Assessment-level feedback that is to be presented
as a result of Assessment-level processing of the user responses:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;!ELEMENT assessfeedback (qticomment? , (material+ | flow_mat+))&gt;
&lt;!ATTLIST assessfeedback  
        view    (All | Administrator | AdminAuthority | Assessor | Author |
                        Candidate | InvigilatorProctor | Psychometrician | Scorer | 
                        Tutor ) &#39;All&#39;
        ident CDATA  #REQUIRED
        title CDATA  #IMPLIED &gt;
</pre></div>
</div>
</dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">1.2. IMS Question and Test Interoperability (version 1.2)</a><ul>
<li><a class="reference internal" href="#questestinterop-elements">1.2.3. QuesTestInterop Elements</a></li>
<li><a class="reference internal" href="#object-bank-elements">1.2.4. Object Bank Elements</a></li>
<li><a class="reference internal" href="#assessment-elements">1.2.5. Assessment Elements</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="imscpv1p2.html"
                        title="previous chapter">1.1. IMS Content Packaging (version 1.2)</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="qtiv1/core.html"
                        title="next chapter">1.2.1. Core Types and Utilities</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="_sources/imsqtiv1p2p1.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="qtiv1/core.html" title="1.2.1. Core Types and Utilities"
             >next</a> |</li>
        <li class="right" >
          <a href="imscpv1p2.html" title="1.1. IMS Content Packaging (version 1.2)"
             >previous</a> |</li>
        <li><a href="index.html">Pyslet 0.4.20140526 documentation</a> &raquo;</li>
          <li><a href="ims.html" >1. IMS Global Learning Consortium Specifications</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright ©2008-2014, Steve Lay.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.1.
    </div>
  </body>
</html>